The present invention relates to a scheme for storing metadata in a storage medium, and more specifically, it relates to a metadata writing method, a metadata reading method, a file management system, a computer system, and a program product used to store metadata in a storage medium.
A data format and software implementation called an LTFS (Linear Tape File System) format and LTFS software which enable access to a tape medium via an interface of a typical file system are known. The LTFS format is an open specification, and file systems that support tape media to which writing is performed in accordance with the LTFS format are implemented by multiple vendors including International Business Machines Corporation® (IBM® (registered trademark)), Oracle®, and Hewlett Packard®. By using the LTFS, an application that uses hard disk drives or flash memory can access tape media without modification.
In the LTFS format, a tape medium divided into two partitions called an index partition and a data partition is used (see Japanese Patent Application Publication No. 2012-65087, for example). The most recent index is written to the index partition, and content data of files and multiple versions of the index (histories of the index) including the most recent index are written to the data partition. The index contains pointers to content data of the files in the data partition and contains file attribute information, such as file names. Content data in the data partition is not accessible without the index, and therefore, the index is written to the tape medium on a regular or irregular basis.
It is known that the capacity of the index is typically about 1 KB per file (that is, about 1 GB for 1 million files). However, this is a typical example, and the capacity of the index may vary depending on the actual capacity of metadata. For example, a fork, such as an ADS (Alternate Data Stream) or a resource fork, may have any capacity, and therefore, may have a capacity comparable to that of the file content. In a case where a file that has metadata, such as a fork, is used, the size of the index may increase.
Accordingly, as the size of the index increases, writing of the index takes longer, and a situation may arise where the index is unable to fit in an index partition of a certain size. As described above, multiple versions of the index are cumulatively written to the data partition, and therefore, an increase in the size of the index may result in a shortage of available resources of the tape medium.